Skip to content

Conversation

Zeophlite
Copy link
Contributor

@Zeophlite Zeophlite commented Aug 10, 2025

Objective

Solution

Testing

index d01c18d7a2..cbe4fa00db 100644
--- a/crates/bevy_text/Cargo.toml
+++ b/crates/bevy_text/Cargo.toml
@@ -37,7 +37,6 @@ bevy_platform = { path = "../bevy_platform", version = "0.17.0-dev", default-fea
 
 # other
 cosmic-text = { version = "0.14", features = ["shape-run-cache"] }
-cosmic_undo_2 = { version = "0.2.0" }
 thiserror = { version = "2", default-features = false }
 serde = { version = "1", features = ["derive"] }
 smallvec = { version = "1", default-features = false }
diff --git a/crates/bevy_text/src/input.rs b/crates/bevy_text/src/input.rs
index ab462ad6e8..0880b2d0f9 100644
--- a/crates/bevy_text/src/input.rs
+++ b/crates/bevy_text/src/input.rs
@@ -150,7 +150,7 @@ impl TextInputBuffer {
 #[derive(Component, Debug, Default)]
 pub struct UndoHistory {
     /// The commands to undo and undo
-    pub changes: cosmic_undo_2::Commands<cosmic_text::Change>,
+    pub changes: crate::undo_2::Commands<cosmic_text::Change>,
 }
 
 impl UndoHistory {
@@ -477,13 +477,13 @@ pub fn is_cursor_at_end_of_line(editor: &mut BorrowedWithFontSystem<Editor<'_>>)
 /// apply an action from the undo history to the  text input buffer
 fn apply_action<'a>(
     editor: &mut BorrowedWithFontSystem<Editor<'a>>,
-    action: cosmic_undo_2::Action<&cosmic_text::Change>,
+    action: crate::undo_2::Action<&cosmic_text::Change>,
 ) {
     match action {
-        cosmic_undo_2::Action::Do(change) => {
+        crate::undo_2::Action::Do(change) => {
             editor.apply_change(change);
         }
-        cosmic_undo_2::Action::Undo(change) => {
+        crate::undo_2::Action::Undo(change) => {
             let mut reversed = change.clone();
             reversed.reverse();
             editor.apply_change(&reversed);

@Zeophlite Zeophlite force-pushed the text-undo branch 2 times, most recently from a8ddeec to dcaa00b Compare August 10, 2025 10:04
Lints

More lints

Clippy

More

More clippy

Fmt

More doc work

More clippy

More
@Zeophlite Zeophlite marked this pull request as ready for review August 10, 2025 15:39
Copy link
Contributor

@viridia viridia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I would add is a note explaining that the upstreaming is temporary and will be removed when we can.

@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets X-Controversial There is active debate or serious implications around merging this PR S-Needs-SME Decision or review from an SME is required labels Aug 10, 2025
@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Aug 10, 2025
@alice-i-cecile
Copy link
Member

The only thing I would add is a note explaining that the upstreaming is temporary and will be removed when we can.

Indeed: I would like this to be quite clear.

@alice-i-cecile alice-i-cecile changed the title Add undo_2 Temporarily upstream undo_2 Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets S-Needs-SME Decision or review from an SME is required X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants